package cn.lxh.test;


import java.util.List;

/**
 * 计算总和
 */
public class CalculateNum {
    private int sum = 0;

    public Integer Sum(int[] a) {
        for (int i = 0; i < a.length; i++) {
            sum = sum + a[i];
        }
        return sum;
    }

    /**
     *  全部相同同
     * @param a
     * @return
     */
    public Integer FullHouse(int[] a) {
        sum = Sum(a) + 50;
        return sum;
    }

    /**
     * 两个相同-最大两个两个数求和
     * @param a
     * @param list
     * @return
     */
    public Integer Pairs(int[] a, List<Integer> list) {
        sum = Sum(a) + list.get(0) * 2;
        return sum;
    }

    /**
     * 两个两个相同
     * @param a
     * @param list
     * @return
     */
    public Integer TwoPair(int[] a, List<Integer> list) {
        sum = Sum(a) + list.get(0) * 2 + list.get(1) * 2;
        return sum;
    }

    /**
     * 三个相同
     * @param a
     * @param list
     * @return
     */
    public Integer ThreeOfAKing(int[] a, List<Integer> list) {
        sum = Sum(a) + list.get(0) * 3;
        return  sum;
    }

    /**
     * 四个相同
     * @param a
     * @param list
     * @return
     */
    public Integer FourOfAKing(int[] a, List<Integer> list) {
        sum = Sum(a) + list.get(0) * 4;
        return  sum;
    }

    /**
     * 小顺子
     * @param a
     * @return
     */
    public Integer SmallStraight(int[] a) {
        sum = Sum(a) +15;
        return sum;
    }

    /**
     * 大顺子
     * @param a
     * @return
     */
    public Integer LagerStraight(int[] a) {
        sum = Sum(a) * 20;
        return sum;
    }

    /**
     * 三张相同加一对
     * @param a
     * @return
     */
    public Integer ThreeOfAKingAndPairs(int[] a) {
        sum = Sum(a) * 2;
        return  sum;
    }

}
